const path = require("path")

const modules = {}
let files = require.context('./', true, /^\.\/.*\.js$/)
files.keys().forEach(key => {
  const name = path.basename(key, ".js")
  if (name !== 'index') {
    modules[name] = files(key).default || files(key)
  }
})

module.exports = modules;